package day04;

/**
 * 循环结构while的演示
 */
public class WhileDemo {
    public static void main(String[] args) {
        //输出五次"行动是成功的阶梯"
        int times = 0;
        while (times < 5) {
            System.out.println("行动是成功的阶梯");
            times++;
        }

        //输出9的乘法表
        int num = 1;
        while (num <= 9) {
            System.out.println(num + "*9=" + num * 9);
            num++;
        }
        System.out.println("继续执行");

        //输出五次”行动是成功的阶梯“输出过程：
        int times1 = 0;
        while (times1 < 5) {
            System.out.println("行动是成功的阶梯");
            times1++;
        }
        /**     times1=0
         * ture   输出    times1=1
         * ture   输出    times1=2
         * ture   输出    times1=3
         * ture   输出    times1=4
         * ture   输出    times1=5
         * false  while输出结束
         */

        //输出9*9乘法表
        int num1 = 1;
        while(num1<=9){
            System.out.println(num1+"*1="+num1*1);
            System.out.println(num1+"*2="+num1*2);
            System.out.println(num1+"*3="+num1*3);
            System.out.println(num1+"*4="+num1*4);
            System.out.println(num1+"*5="+num1*5);
            System.out.println(num1+"*6="+num1*6);
            System.out.println(num1+"*7="+num1*7);
            System.out.println(num1+"*8="+num1*8);
            System.out.println(num1+"*9="+num1*9);
            num1++;
        }












    }
}
